package me.stone.stanimeclient.core.ui.binding.adapters

import android.widget.TextView
import androidx.annotation.StringRes
import androidx.databinding.BindingAdapter

@BindingAdapter("textResId")
fun textResId(view: TextView, @StringRes resId: Int?) {
    resId?.takeIf { it != 0 }?.let {
        view.setText(it)
    }
}

@BindingAdapter("charSequence")
fun setCharSequence(view: TextView, content: CharSequence) {
    view.text = content
}